#include "CEffect.h"
#include "CLevelEditor.h"

extern CLevelEditor* editor;

CEffect::CEffect(stringw effectName)
{
	m_effectName = effectName;
}

CEffect::~CEffect()
{
	for (u32 i=0; i < m_ParticleSystems.size(); i++)
	{
		m_ParticleSystems[i]->remove();
		m_ParticleSystems[i]->drop();
	}

	m_ParticleSystems.clear();
}

void CEffect::SetVisible(bool bVisible)
{
	for (u32 i=0; i < m_ParticleSystems.size(); i++)
	{
		m_ParticleSystems[i]->setVisible(bVisible);
		if(bVisible)
			m_ParticleSystems[i]->Restart();
	}
}
